package com.zcy.feign;

import com.zcy.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

//这个注解的意思：当前这个接口中所有的方法，都会访问 USER-PROVIDER 实例
@FeignClient(value = "USER-PROVIDER",fallbackFactory = HystrixFallbackFactory.class)
public interface UserClient {
    //注意：这里在写请求时，不能使用@GetMapper/@postMapping

    @RequestMapping(value = "/user/{id}",method = RequestMethod.GET)
    User findById(@PathVariable("id") Long id);
}
